projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
624ac85
)
Prevent a crash in the TGA loader
author
Matthias Clasen
<mclasen@redhat.com>
Tue, 23 Feb 2010 16:50:25 +0000
(11:50 -0500)
committer
Tristan Van Berkom
<tristan.van.berkom@gmail.com>
Sun, 4 Apr 2010 00:56:21 +0000
(20:56 -0400)
Reported in bug 609744.
gdk-pixbuf/io-tga.c
patch
|
blob
|
history
diff --git
a/gdk-pixbuf/io-tga.c
b/gdk-pixbuf/io-tga.c
index e42758c1980336d17cb13d7a8a1979c53f2adbf0..0391e1eec9df366c1343a8337dea772ceb5be065 100644
(file)
--- a/
gdk-pixbuf/io-tga.c
+++ b/
gdk-pixbuf/io-tga.c
@@
-679,7
+679,13
@@
static gboolean try_colormap(TGAContext *ctx, GError **err)
static guint n;
g_return_val_if_fail(ctx != NULL, FALSE);
- g_return_val_if_fail(ctx->cmap_size > 0, TRUE);
+
+ if (ctx->cmap_size == 0) {
+ g_set_error_literal(err, GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+ _("Image is corrupted or truncated"));
+ return FALSE;
+ }
ctx->cmap = g_try_malloc(sizeof(TGAColormap));
if (!ctx->cmap) {